package com.geely.design.pattern.behavioral.mediator;

public class User {
    private String name;

    public User(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    // 调用StudyGroup类的方法来发送消息, 将当前对象this传进去了, 也就能拿到当前对象的属性和方法了
    // 把this自己和参数全都传给中介者来玩
    public void sendMessage(String message) {
        StudyGroup.showMessage(this,message);
    }

}
